/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.ibm.law.domain;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author shanch
 */
@Entity
@Table(name = "filetype")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "FileType.findAll", query = "SELECT f FROM FileType f"),
    @NamedQuery(name = "FileType.findById", query = "SELECT f FROM FileType f WHERE f.id = :id"),
    @NamedQuery(name = "FileType.findByName", query = "SELECT f FROM FileType f WHERE f.name = :name"),
    @NamedQuery(name = "FileType.findByCode", query = "SELECT f FROM FileType f WHERE f.code = :code")})
public class FileType extends AbstractModelObject  implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "id")
    private Long id;
    @Column(name = "name")
    private String name;
    @Column(name = "code")
    private String code;

    public FileType() {
    }

    public FileType(Long id) {
        this.id = id;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
    	String oldValue=this.name;
        this.name = name;
    	firePropertyChange("name",oldValue, name);
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
    	String oldValue=this.code;
        this.code = code;
        firePropertyChange("code",oldValue, code);
    }



    @Override
    public String toString() {
        return "com.ibm.law.entity.Filetype[ id=" + id + " ]"+name+code;
    }
    
}
